import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useNotificationStore = defineStore('notification', () => {
  const title = ref('')
  const message = ref('')
  const type = ref<'success' | 'warning' | 'info' | 'error'>('info')
  
  const show = (options: {
    title?: string
    message: string
    type?: 'success' | 'warning' | 'info' | 'error'
  }) => {
    title.value = options.title || ''
    message.value = options.message
    type.value = options.type || 'info'
  }
  
  const clear = () => {
    message.value = ''
  }
  
  return { title, message, type, show, clear }
})